package ysq.xyg.shop.model.po;

import lombok.NoArgsConstructor;

import lombok.Data;
import ysq.xyg.base.util.BaseConstant;
import ysq.xyg.base.util.BaseUtil;
import ysq.xyg.sys.model.po.SysUser;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * 商城模块-用户地址实体类
 *
 * @author congcong tao
 * @date 2019-5-27 7:34:48
 */
@Data
@NoArgsConstructor
@Table(name = "xyg_shop_address")
public class ShopAddress implements Serializable{

	/**
     * 主键
     */ 
	@Id
	private String id;

	@Column(name = "member_id")
	private String memberId;

	@Column(name = "link_name")
	private String linkName;

	@Column(name = "phone")
	private String phone;

	/**
     * 地址名称
     */ 
	@Column(name = "name")
	private String name;

	/**
     * 类型1=有户号2=无户号
     */ 
	@Column(name = "door_type")
	private String doorType;

	/**
     * 幢
     */ 
	@Column(name = "building")
	private String building;

	/**
     * 单元
     */ 
	@Column(name = "unit")
	private String unit;

	/**
     * 室
     */ 
	@Column(name = "room")
	private String room;

	/**
     * 详细地址
     */ 
	@Column(name = "descripts")
	private String descripts;

	/**
     * 是否默认地址：1、是，2、否
     */ 
	@Column(name = "type")
	private String type;

	/**
     * 排序
     */ 
	@Column(name = "orderNum")
	private String orderNum;

	/**
     * 创建者
     */ 
	@Column(name = "create_user")
	private String createUser;

	/**
     * 创建时间
     */ 
	@Column(name = "create_time")
	private Date createTime;

	/**
     * 删除状态1、未删除2、已删除
     */ 
	@Column(name = "remove_tag")
	private String removeTag;

	/**
     * 更新者
     */ 
	@Column(name = "update_user")
	private String updateUser;

	/**
     * 更新时间
     */ 
	@Column(name = "update_time")
	private Date updateTime;

	public ShopAddress(SysUser sysUser) {
		this.id= BaseUtil.uId();
		this.removeTag= BaseConstant.BASE_REMOVE_TAG_NORMAL;
		this.createTime = new Date();
		this.createUser = sysUser.getId();
		this.updateTime = new Date();
		this.updateUser = sysUser.getId();
	}
}